/**********************************************************************
 Copyright (C) 2010 Teppo Eeva

 This file is part of Arithmetic Game.
 For more information, see <http://code.google.com/p/arithmetic-game/>

 Arithmetic Game is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 Arithmetic Game is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with Arithmetic Game.  If not, see <http://www.gnu.org/licenses/>.
 **********************************************************************/

#include <QtTest/QtTest>
#include <QDateTime>
#include <QDebug>

#include "arithQuestion.h"


class TestArithQuestion : public QObject
{
    Q_OBJECT

private slots:
    // Setup test case
    void initTestCase();

    // Actual test cases
    void doTest1();
    void doTest2();
    void doTest3();
    void doTest88();

    // Cleanup test case
    void cleanupTestCase();

private:

};


void TestArithQuestion::initTestCase()
{
    qDebug() << "-- START -- TestArithQuestion";
    qsrand(QDateTime::currentDateTime().toTime_t());
}

void TestArithQuestion::cleanupTestCase()
{
    qDebug() << "-- END -- TestArithQuestion";
}

void TestArithQuestion::doTest1()
{
    ArithQuestion* q1 = new ArithQuestion(1);
    Operation op = q1->operation();
    QVERIFY( op ==  Addition );
    qDebug() << "doTest1: " << op;
    delete q1;    
}

void TestArithQuestion::doTest2()
{
    ArithQuestion* q2 = new ArithQuestion(2);
    Operation op = q2->operation();
    QVERIFY( op ==  Addition || op == Subtraction );
    qDebug() << "doTest2: " << op;
    delete q2;
}

void TestArithQuestion::doTest3()
{
    ArithQuestion* q3 = new ArithQuestion(3);
    Operation op = q3->operation();
    QVERIFY( op ==  Addition || op == Subtraction || op == Multiplication );
    qDebug() << "doTest3: " << op;
    delete q3;
}

void TestArithQuestion::doTest88()
{
    ArithQuestion* q88 = new ArithQuestion(88);
    Operation op = q88->operation();
    QVERIFY( op ==  Addition || op == Subtraction || op == Multiplication );
    qDebug() << "doTest88: " << op;
    delete q88;
}


QTEST_MAIN(TestArithQuestion)
#include "testarithquestion.moc"
